# include "GameTexture.h"
# include "ResourceManager.h"

using WuguiEngine::Utility::UtilityTools;

namespace WuguiEngine
{
	namespace Graphics
	{
		GameTexture::GameTexture(GraphicsDevice* device, string _filename)
		{
			ResourceManager* pResourceMgr = ResourceManager::GetInstance();

			pTexture = (IDirect3DTexture9*)(pResourceMgr->
				GetD3DResource(_filename, device,ResourceType::RTTexture));

			pDevice = device;
			filename = _filename;
		}

		IDirect3DTexture9* GameTexture::GetD3D9Texture()
		{
			return pTexture;
		}

		void GameTexture::Dispose()
		{
			ResourceManager::GetInstance()->DisposeD3DResource(filename);
			pTexture = NULL;
		}
	}
}